function MDPP.Panel( panel )
	panel:ClearControls()

	if (!MDPP:IsEnabled()) then
		Panel:AddControl("Label", {Text = "MadDog's Prop Protection is currently disabled."})
		return
	end

	if (!MDPP.ClientCpanel) then MDPP.ClientCpanel = panel end

	panel:AddControl("Label", {Text = "MadDog's Prop Protection"})

	panel:AddControl("Button", {Text = "Cleanup All Props", Command = "MDPP_CleanupProps"})
	panel:AddControl("Label", {Text = "Buddies Panel"})

	local Players = player.GetAll()

	if (table.Count(Players) == 1) then
		panel:AddControl("Label", {Text = "No Other Players Are Online"})
	else
		for _, ply in pairs(Players) do
		--	if (ply and ply:IsValid() and ply != LocalPlayer()) then
				local cmd = "MDPP_Buddy_"..ply:GetNWString("SteamID")

				--create new buddy command
				if (!LocalPlayer():GetInfo(cmd)) then CreateClientConVar(cmd, 0, false, true) end

				panel:AddControl("CheckBox", {Label = ply:Nick(), Command = cmd})
		--	end
		end

		panel:AddControl("Button", {Text  = "Apply Settings", Command = "MDPP_ApplyBuddySettings"})
	end

	panel:AddControl("Button", {Text  = "Clear All Buddies", Command = "MDPP_ClearBuddies"})
end



function MDPP.SpawnMenuOpen()
	if (MDPP.ClientCPanel) then MDPP.Panel(MDPP.ClientCPanel) end
end
hook.Add("SpawnMenuOpen", "MDPP.SpawnMenuOpen", MDPP.SpawnMenuOpen)

function MDPP.PopulateToolMenu()
	spawnmenu.AddToolMenuOption("MadDog's Systems", "Settings", "Prop Protection", "Prop Protection", "", "", MDPP.Panel)
end
hook.Add("PopulateToolMenu", "MDPP.PopulateToolMenu", MDPP.PopulateToolMenu)